home *** CD-ROM | disk | FTP | other *** search
/ The Mac 13 / the-mac-13.iso / Shareware City / Demos / TextPak Demo / Extras / GlobalConstants.k < prev    next >
Encoding:
Text File  |  1995-06-09  |  1.4 KB  |  42 lines  |  [TEXT/MPS ]

  1. --
  2. --     © 1994, 1995 Art of Memory Ltd.
  3. --     All Rights Reserved
  4. --
  5. -- This file is supplied as part of the TextPak demonstration. You are only
  6. -- entitled to use this software to understand how the demonstration works.
  7. -- You may not duplicate, modify, reproduce or distribute this software in
  8. -- any form. If you wish to purchase a licence to use this software, please
  9. -- contact Art of Memory Ltd.
  10. --
  11. class GlobalConstantsLoader is ANY;
  12.  
  13. has
  14.     BitDepth;                -- Bit depth of application
  15.     MediaRoot;                -- Path to media folder
  16.     TextRepository;            -- Path to folder containing text items
  17.     CentralTextFileName;    -- Optional name of the single text file in the repository
  18.     FileSeparator;            -- PD: Char used to separate folders in path names
  19.     
  20.     -- Load the basic preferences, returning the loaded COLLECTION so
  21.     -- that extra parsing can be done.
  22.     LoadPreferences(prefsFileName)
  23.         prefsFileName is? STRING;
  24.         
  25.     use
  26.         thePreferences;
  27.     
  28.     do
  29.         FileSystem.OpenTextFile(prefsFileName, 'r');
  30.         thePreferences := FileSystem.ReadTextFile();
  31.         FileSystem.CloseTextFile();
  32.         
  33.         self.BitDepth               := (thePreferences @ 1).ToInteger();
  34.         self.MediaRoot              := thePreferences @ 2;
  35.         self.TextRepository         := thePreferences @ 3;
  36.         self.CentralTextFileName    := thePreferences @ 4;
  37.         
  38.         self.FileSeparator := FileSystem.GetDirectorySeparator();
  39.         
  40.         result := thePreferences; 
  41.     end;
  42. end;